<template>
  <div>
    <div class="onebox" v-for="item in goodlist" :key="item.id">
      <div class="left">
        <img :src="item.img" alt="" />
      </div>
      <div class="right">
        <h3>{{ item.title }}</h3>
        <p class="red">￥{{ item.price }}</p>
        <p class="gray">已售出{{ item.count }}件</p>
        <button>立即抢购</button>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      goodlist: [
        {
          id: 1,
          img: require("../../assets/img/1.webp"),
          title: "叶斯莫德",
          price: 123.0,
          count: 800,
        },
        {
          id: 2,
          img: require("../../assets/img/1.webp"),
          title: "叶斯莫德",
          price: 123.0,
          count: 800,
        },
        {
          id: 3,
          img: require("../../assets/img/1.webp"),
          title: "叶斯莫德",
          price: 123.0,
          count: 800,
        },
      ],
    };
  },
  mounted(){
    
  }
};
</script>

<style scoped>
.onebox {
  width: 7.1rem;
  box-shadow: 0 0 5px #333;
  display: flex;
  margin-bottom: 0.2rem;
}
.onebox .left {
  width: 3rem;
  overflow: hidden;
}
.onebox .left img {
  display: block;
  margin-top: 0.1rem;
  width: 3rem;
}
.onebox .right {
  flex: 1;
  padding: 0 0 0 0.2rem;
}
.onebox .right h3 {
  font-weight: 400;
  font-size: 0.3rem;
  /* line-height: 0.5rem; */
  padding: 0.1rem 0 0 0;
}
.red {
  font-size: 0.3rem;
  color: red;
  padding: 0.1rem 0;
}
.gray {
  color: #666;
  font-size: 0.25rem;
}
.onebox .right button {
  outline: none;
  border: none;
  font-size: 0.3rem;
  background-color: orangered;
  text-align: center;
  color: #fff;
  padding: 0.1rem 0.2rem;
  border-radius: 0.1rem;
}
</style>